<?
	include($_SERVER['DOCUMENT_ROOT'].'/admin/template.php'); 
	
	$link = getDbLink();
	$weekNr = $_POST["weekNr"];
	$restId = $_POST["restId"];
	$delete = true;
	if(isset($_POST['delete']) && $_POST["delete"] == "false")
	{
		$delete = false;
	}
	
	for ($i = 1; $i < 6; ++$i)
	{	
		$timestamp = getDateforWeek($i, $weekNr);
		$formated_date = date("Y-m-d", $timestamp);
		if ($delete)
		{
			$query = sprintf("delete from menu_food where restaurant_id = %d and menu_date = '%s'", $restId, $formated_date);
			mysql_query($query, $link);
		}
		$query = sprintf("insert into menu_food (food_text, restaurant_id, menu_date) values ('%s',%d,'%s')",trim($_POST["day".$i]), $restId, $formated_date);
		mysql_query($query, $link);
	}
?>

Der Men&uuml;plan wurde aktualisiert. <a href="/admin/start.php">Klicken Sie hier, um zur Startseite zu gelangen</a>